<!--/**
 * Plugin Name: 论坛展示型app
 * Description: uloug.com To develop and share! Please keep the copyright information!
 * Author: 拾讯网
 * Author URI: http://www.uloug.com
 * Version: 1.0
 * Plugin URI: https://git.oschina.net/858598758/apicloud.mao10.app.demo.git
 * License: GPL2+
 */-->
<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
		<style>
			body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td {
				margin: 0px;
				padding: 0px;
			}
			body {
				height: 100%;
				width: 100%;
			}
			#wrap {
				height: 100%;
				display: -webkit-box;
				display: -webkit-flex;
				display: flex;
				-webkit-box-orient: vertical;
				-webkit-flex-flow: column;
				flex-flow: column;
			}
			#main {
				-webkit-box-flex: 1;
				-webkit-flex: 1;
				flex: 1;
			}
			#footer {
				width: 100%;
				text-align: center;
				height: 56px;
				line-height: 55px;
				background-color: #f2f2f2;
			}
			#headercxd {
				width: 100%;
			}
			ul {
				display: -webkit-box;
				display: -webkit-flex;
				display: flex;
			}
			.cloud {
				background-image: url(image/bottombtn0101.png);
			}
			.client {
				background-image: url(image/bottombtn0201.png);
			}
			.dev {
				background-image: url(image/bottombtn0301.png);
			}
			.doc {
				background-image: url(image/bottombtn0401.png);
			}
			#footer li {
				-webkit-box-flex: 1;
				-webkit-flex: 1;
				flex: 1;
				height: 55px;
			}
			.bottom_btn {
				background-position-y: 4px;
				padding-top: 16px;
				font-size: 12px;
				color: #323237;
				width: 99%;
				height: 39px;
				background-repeat: no-repeat no-repeat;
				background-position-x: center;
				background-size: 30px;
			}
			.active .cloud {
				background-image: url(image/bottombtn0102.png);
			}
			.active .client {
				background-image: url(image/bottombtn0202.png);
			}
			.active .dev {
				background-image: url(image/bottombtn0302.png);
			}
			.active .doc {
				background-image: url(image/bottombtn0402.png);
			}
			.active .bottom_btn {
				color: #6ab494;
				background-size: 30px;
			}
			.topbar {
				background: #f8285c;
				width: 100%;
				height: 50px;
				border-bottom: 1px solid #DDDFE3;
				line-height: 50px;
				text-align: center;
				display: none;
				color: #FFF;
			}
			.activebar {
				display: block;
			}
			/*header-text*/
			#header-title {
				max-width: 200px;
				overflow: height;
				text-align: center;
			}
			/*底部高度*/
			.aui-nav {
				height: 45px;
			}
			.aui-nav .aui-bar-tab .aui-iconfont {
				line-height: 39px;
			}
		</style>
	</head>
	<body>
		<header class="aui-bar aui-bar-nav aui-bar-warning" id="aui-header">
			<a class="aui-pull-left" tapmode onclick="closeWin()"> <span class="aui-iconfont aui-icon-left"></span></a>
			<div class="aui-title" id="header-title">
				拾味商城
			</div>
			<a class="aui-pull-right" tapmode onclick=""> <span class="aui-iconfont aui-icon-moreandroid"></span> </a>
		</header>
		<footer class="aui-nav" id="aui-footer">
			<ul class="aui-bar-tab">
				<li id="tabbar1" tapmode onclick="openhback()">
					<span class="aui-iconfont aui-icon-left"></span>
				</li>
				<li id="tabbar2" tapmode onclick="G_refresh()">
					<span class="aui-iconfont aui-icon-refresh"></span>
				</li>
				<li id="tabbar3" tapmode onclick="historyForward()">
					<span class="aui-iconfont aui-icon-right"></span>
				</li>
				<li id="tabbar4" tapmode onclick="">
					<span class="aui-iconfont aui-icon-forward"></span>
				</li>
			</ul>
		</footer>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/common_do.js"></script>
	<script type="text/javascript">
		apiready = function() {
			goods_frm();
		}
		function goods_frm() {
			api.showProgress({
				title : '加载中...',
				modal : false
			});
			//获取上级传值
			var goods_id = api.pageParam.goodsid;
			var header = $api.byId('aui-header');
			$api.fixStatusBar(header);
			var headerPos = $api.offset(header);
			var body_h = $api.offset($api.dom('body')).h;
			var footer_h = $api.offset($api.byId('aui-footer')).h;
			api.ajax({
				url : goods_url_id + goods_url_com + '?id=' + goods_id,
				method : 'get',
				cache : true,
				dataType : 'json',
			}, function(ret, err) {
				if (ret) {
					$api.html($api.dom('.aui-title'), ret.title);
					api.openFrame({
						name : 'goods_frm',
						url : ret.android_click_url,
						rect : {
							x : 0,
							y : headerPos.h,
							w : 'auto',
							h : body_h - headerPos.h - footer_h
						},
						bounces : true,
						bgColor : 'rgba(F,0,0,0)',
						vScrollBarEnabled : true,
						hScrollBarEnabled : true
					});
					api.hideProgress();
					api.refreshHeaderLoadDone();
				} else {
					alert(JSON.stringify(err));
					api.hideProgress();
				}
			});
		}

		//关闭
		function closeWin() {
			api.closeWin();
		}

		//历史记录后退
		function openhback() {
			api.historyBack({
				frameName : 'goods_frm'
			}, function(ret, err) {
				if (!ret.status) {
					api.closeWin();
				}
			});
		}

		//历史记录前进
		function historyForward() {
			api.historyForward({
				frameName : 'goods_frm'
			}, function(ret, err) {
				if (!ret.status) {
				}
			});
		}

		// 点击刷新
		function G_refresh() {
			opengoods();
		}
	</script>
</html>